<template>
	<scroll-view scroll-y="true" class="main" @scrolltolower="more">
		<view class="detaillist" v-for="(item,index) of list">
			<view class="detaillist_top u-m-tb-30 flex">
				<view class="u-font-28" v-if="item.state==0">待审核</view>
				<view class="u-font-28" v-else-if="item.state==1">提现成功</view>
				<view class="" v-else>提现驳回</view>
				<text class="u-font-bold u-font-32" style="color: #00CE9B;">+￥{{item.num}}</text>
			</view>
			<view class="detaillist_top flex u-font-22">
				<text style="color: #C9CCD5;">{{item.createtime|date}}</text>
				<text v-if="item.state==1" style="color: #8D93A5;">实际到账¥{{item.act_num}}</text>
			</view>
		</view>
		<u-empty mode="list" v-if="finish && list.length === 0" style="margin-top: 200rpx;" icon="/static/none.png">
				</u-empty>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				finish: false,
				list: [],
			};
		},
		onLoad() {
			this.reload()
		},
		methods:{
			reload() {
				this.page = 1
				this.list = []
				this.finish = false
				this.getList()
			},
			more() {
				this.page++
				this.getList()
			},
			getList() {
				if (this.finish) {
					return
				}
				this.$api.post('/withdraw', {
					page: this.page,
					types: 'list'
				}).then(res => {
					if (res.code == 1) {
						this.list = this.list.concat(res.data.list)
						if (res.data.list.length === 0) {
							this.finish = true
						}
					}
				}).catch((res) => {
					
				})
			},
		}
	}
</script>

<style lang="scss">
	.main{
		height: 100vh;
		overflow: hidden;
	}
.detaillist{
	border-radius: 30rpx;
	background-color: #fff;
	padding: 30rpx;
	width: 90%;
	margin: 30rpx auto;
	.detaillist_top{
		justify-content: space-between;
	}
}
.center{
	transform: translateY(50%);
}
</style>
